<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="tab">点击隐藏iframe</div>
    <br />
    <div id="iframeID">
      <iframe src="./resizeObserver.html" frameborder="0"></iframe>
    </div>

    <script>
      const iframe = document.getElementById("iframeID");
      document.getElementById("tab").addEventListener("click", () => {
        iframe.style.display =
          iframe.style.display === "none" ? "block" : "none";
      });
    </script>
  </body>
</html>
